package com.wzcl.app.model.vo;

import com.wzcl.app.dao.model.Requisition;
import com.wzcl.app.model.common.WZCL;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Map;

@Data
public class RequisitionVo extends BaseVo {

    @ApiModelProperty(name = "年级id")
    private Integer gradeId;

    @ApiModelProperty(name = "年级")
    private String gradeName;

    @ApiModelProperty(name = "学科Id")
    private Integer subjectId;

    @ApiModelProperty(name = "学科")
    private String subjectName;

    @ApiModelProperty(name = "用户id")
    private Integer userId;

    @ApiModelProperty(name = "用户手机")
    private String userPhone;

    @ApiModelProperty(name = "用户真实姓名")
    private String userRealName;

    @ApiModelProperty(name = "处理结果")
    private String result;

    @ApiModelProperty(name = "加星标记")
    private Boolean star;

    @ApiModelProperty(value = "进度")
    private Integer schedule;
    private String scheduleStr;

    private RequisitionVo() {
    }

    public static RequisitionVo create(Requisition requisition){
        RequisitionVo requisitionVo = new RequisitionVo();
        BeanUtils.copyProperties(requisition,requisitionVo);
        requisitionVo.translationValueStr();
        return requisitionVo;
    }

    @Override
    public void translationValueStr() {
        Map<String, Map<Integer, String>> map = getTranslationMap();
        this.scheduleStr = map.get(WZCL.GROUP_NAME.SCHEDULE).get(this.schedule);
    }

    @Override
    public void processResources() {

    }
}
